Field of the Invention
The present invention relates to an image pickup apparatus which corrects the contrast of an image, a control method for the image pickup apparatus, and a storage medium.
Description of the Related Art
Conventionally, there is known a correction method to correct the contrast of an image obtained by shooting (see, for example, Japanese Laid-Open Patent Publication (Kokai) No. 2006-98614). According to the correction method described in Japanese Laid-Open Patent Publication (Kokai) No. 2006-98614, a tone curve for use in correcting the contrast of an image is generated from a luminance histogram of the image. Specifically, a low-tone area of the tone curve is calculated from a frequency distribution (frequency percentage) of low luminance in the luminance histogram, and a high-tone area of the tone curve is calculated from a frequency distribution of high luminance in the luminance histogram, and a mid-tone area of the tone curve is calculated from the low-tone area and the high-tone area. The contrast of an image is then corrected using a calculated tone curve across the overall tone range. As a result, an image with smooth tone continuity across the overall image is obtained.
Some images whose contrast is to be corrected are at least partially blurred (hereafter referred to as a “blurred image”). A blurred image may include not only a subject whose subject distance, which is a distance from an image pickup apparatus to a subject, is short (hereafter referred to as a “short-distance subject”) but also a subject whose subject distance is long (hereafter referred to as a “long-distance subject”). Due to the subject distance being long, shooting of a long-distance subject tends to be more affected by dust floating in the air and sunlight diffusely reflected by moisture in the air than shooting of a short-distance subject. For this reason, in a blurred image, an edge of a long-distance subject tends to be more difficult to recognize than an edge of a short-distance subject. It should be noted that an edge of a subject is made easier to recognize by correcting the contrast of an image of the subject, and the processing intensity with which contrast is corrected depends on a tone curve, and more particularly, its slope.
However, according to the correction method described in Japanese Laid-Open Patent Publication (Kokai) No. 2006-98614, a tone curve is calculated from a histogram across the board regardless of the distance to a subject, and this presents a problem that it is impossible to appropriately correct the contrasts of images of respective subjects. For example, the processing intensity of contrast correction using a calculated tone curve may be too low to correct the contrast of an image of a long-distance subject and may not satisfactorily enhance an edge of the long-distance subject. Also, the processing intensity of contrast correction using a calculated tone curve may be too high to correct the contrast of an image of a short-distance subject and may excessively enhance an edge of the short-distance subject.